<?php

use Biz\service\springHomeDecActivity\ContentService;

class TopicAction extends ActionPlugin
{
    const USER_LEVEL = self::LEVEL_NOTHING;

    const VALIDATOR_TOAST_DEBUG = true;

    //参数校验-规则
    public const VALIDATOR_RULES = [
        'page' => 'require|integer',
    ];

    //参数校验-自定义消息
    public const VALIDATOR_MSG = [
        'page.require' => '参数错误',
    ];

    public function main()
    {
        $page = $this->params['page'] ?? 1;
        $uid = $this->uid ?? 0;
        $topics = ContentService::getTopic($uid,$page);
        $this->setSuccess($topics);
    }
}